package com.heima.article.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.heima.article.mapper.AuthorMapper;
import com.heima.article.service.AuthorService;
import com.heima.model.article.pojos.ApAuthor;
import org.springframework.stereotype.Service;

/**
 *
 */
@Service
public class AuthorServiceImpl extends ServiceImpl<AuthorMapper, ApAuthor> implements AuthorService {

    @Override
    // 根据用户名查找用户
    public ApAuthor findByUserId(Integer userId) {
        return getOne(Wrappers.<ApAuthor>lambdaQuery().eq(ApAuthor::getUserId,userId));
    }
}
